package org.black.phoneUtility.app.service;

import org.black.phoneUtility.sms.reply.app.service.SmsReplyScheduleNotifyNotificationInentService;
import org.black.phoneUtility.sms.schedule.app.service.SmsScheduleSendingService;

import android.app.IntentService;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class StartNeededService extends IntentService {
	private static final String LOG_TAG = StartNeededService.class.getName();

	public StartNeededService() {
		super(StartNeededService.class.getName());
	}

	protected void onHandleIntent(Intent intent) {
		Intent scheduleNotifyNotificationServiceIntent = new Intent(this,
				SmsReplyScheduleNotifyNotificationInentService.class);
		Bundle argumentsForSchedule = new Bundle();
		argumentsForSchedule
				.putInt(SmsReplyScheduleNotifyNotificationInentService.ARGUMENTS_ACTION_TYPE,
						SmsReplyScheduleNotifyNotificationInentService.ACTION_TYPE_RECHECK);
		scheduleNotifyNotificationServiceIntent.putExtras(argumentsForSchedule);
		startService(scheduleNotifyNotificationServiceIntent);

		Log.d(LOG_TAG, "Start SmsReplyScheduleNotifyNotificationInentService!");
		Intent smsScheduleServiceIntent = new Intent(this,
				SmsScheduleSendingService.class);
		smsScheduleServiceIntent
				.putExtra(
						SmsScheduleSendingService.ARGUMENTS_SMS_SCHEDULE_ACTION_TYPE,
						SmsScheduleSendingService.ARGUMENTS_SMS_SCHEDULE_ACTION_TYPE_RECHECK);
		smsScheduleServiceIntent
				.putExtra(
						SmsScheduleSendingService.ARGUMENTS_SMS_SCHEDULE_SHOULD_ACTIVATED,
						false);
		startService(smsScheduleServiceIntent);
		Log.d(LOG_TAG, "Start SmsScheduleSendingService!");
	}
}
